import Icon from '@ant-design/icons'
import { CustomIconComponentProps } from '@ant-design/icons/es/components/Icon'
import { theme } from 'antd'
const ThemeSvg = () => (
  <svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
       width="1em" height="1em" fill="currentColor">
    <path
      d="M736.8 64.7H287.2C175 64.7 83.8 155.9 83.8 268.1V756c0 112.1 91.2 203.4 203.4 203.4h449.7c112.1 0 203.4-91.2 203.4-203.4V268.1C940.2 155.9 849 64.7 736.8 64.7z m149.5 691.2c0 82.4-67 149.5-149.5 149.5H287.2c-82.4 0-149.5-67-149.5-149.5V268.1c0-82.4 67-149.5 149.5-149.5h449.7c82.4 0 149.5 67 149.5 149.5v487.8z"
    ></path>
    <path
      d="M645.2 344.6c-9.7-9.7-23.7-13.8-37.3-10.9-6.5 1.4-12.4 4.1-17.5 8.2-21.1 16.9-47.6 26.2-74.6 26.2h-0.8c-0.8 0-1.6-0.1-2.4-0.1h-1.2c-0.8 0-1.6 0.1-2.4 0.1h-0.8c-27 0-53.6-9.3-74.7-26.2-5.1-4.1-11-6.8-17.5-8.2-13.7-2.9-27.6 1.2-37.3 10.9l-66.8 66.8c-7.5 7.5-11.8 17.8-11.9 28.4v2.6c0.6 11 5.6 21.4 13.9 28.7 13.8 12 28.9 22.8 44.8 32.1 2.9 1.7 4.6 4.7 4.6 7.9v121.8c0 21.2 14.4 39.6 35.1 44.8 35.6 9 72.4 13.5 109.3 13.5h4c38.8 0.3 76.9-4.2 113.8-13.5 20.6-5.2 35.1-23.6 35.1-44.8V511.1c0-3.3 1.7-6.3 4.6-7.9 15.9-9.2 30.9-20 44.8-32.1 8.2-7.1 13.2-17.4 13.9-28.2 0.1-1.1 0.1-2.2 0.1-3.3-0.2-10.5-4.5-20.7-11.9-28.1l-66.9-66.9z m-3.7 117.8c-17.3 10.1-28.1 28.8-28.1 48.7v121c-32.8 8.2-66.7 12.3-101.7 11.9-34.3 0.4-68.5-3.7-101.3-11.9v-121c0-20-10.8-38.6-28.1-48.7-11.3-6.6-22.2-14.1-32.3-22.5l58-58c28.7 21.5 64.1 33.3 100 33.3 1.2 0 2.4-0.1 3.5-0.1h0.4c1.2 0.1 2.4 0.1 3.5 0.1 36 0 71.3-11.8 100-33.3l58 58c-9.7 8.4-20.5 15.9-31.9 22.5z"
    ></path>
  </svg>
)

export const ThemeIcon = (props: Partial<CustomIconComponentProps>) => {
  const { token } = theme.useToken()
  console.log('colorIcon',token.colorIcon)
  return <Icon component={ThemeSvg} style={{ color: token.colorIcon }} {...props} />
}
export const AntdIcon = (props: any) => {
  const { token } = theme.useToken()
  console.log('colorIcon',token.colorIcon)
  return <Icon component={props.component} style={{ color: token.colorIcon }} {...props} />
}